Replace gdk_threads_add_timeout* with g_timeout_add()
authorEmmanuele Bassi <ebassi@gnome.org>
Fri, 2 Feb 2018 14:51:47 +0000 (15:51 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Sat, 3 Feb 2018 11:06:58 +0000 (12:06 +0100)
The main GDK thread lock is not portable and deprecated.

The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.

Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.

https://bugzilla.gnome.org/show_bug.cgi?id=793124

43 files changed:
demos/gtk-demo/images.c
gdk/gdkframeclockidle.c
gdk/wayland/gdkdevice-wayland.c
gdk/win32/gdkdnd-win32.c
gdk/win32/gdkselection-win32.c
gdk/x11/gdkdnd-x11.c
gtk/gtkbutton.c
gtk/gtkcalendar.c
gtk/gtkcellrenderertext.c
gtk/gtkdnd.c
gtk/gtkentry.c
gtk/gtkentrycompletion.c
gtk/gtkexpander.c
gtk/gtkfilechooserwidget.c
gtk/gtkfilesystemmodel.c
gtk/gtkgesturelongpress.c
gtk/gtkgesturemultipress.c
gtk/gtkiconview.c
gtk/gtkmenu.c
gtk/gtkmenuitem.c
gtk/gtknotebook.c
gtk/gtkprintoperation-win32.c
gtk/gtkprintoperation.c
gtk/gtkrange.c
gtk/gtkrecentmanager.c
gtk/gtkscrolledwindow.c
gtk/gtkspinbutton.c
gtk/gtkstackswitcher.c
gtk/gtktextview.c
gtk/gtktooltip.c
gtk/gtktreeview.c
gtk/gtkwindow.c
gtk/inspector/misc-info.c
gtk/inspector/statistics.c
modules/printbackends/cups/gtkprintbackendcups.c
tests/testassistant.c
tests/testcombo.c
tests/testcombochange.c
tests/testdnd.c
tests/testentrycompletion.c
tests/testgtk.c
tests/testtoolbar.c
tests/testtreeflow.c

index b6393cf34a93de5b71ef80d34783e9e0d7fd9786..c3f0f675f6b099c9ec203a10dd9dec8773b6e894 100644 (file)
@@ -261,9 +261,7 @@ start_progressive_loading (GtkWidget *image)
    * The timeout simply simulates a slow data source by inserting
    * pauses in the reading process.
    */
-  load_timeout = gdk_threads_add_timeout (150,
-                                progressive_timeout,
-                                image);
+  load_timeout = g_timeout_add (150, progressive_timeout, image);
   g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout");
 }
 
index 371450278dba5fc09c9ff8def55d8180b0f7075a..ebb7efe71347f856d8940252f5de8184bdca0c38 100644 (file)
@@ -237,22 +237,22 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
 
       if (priv->flush_idle_id == 0 && RUN_FLUSH_IDLE (priv))
         {
-          priv->flush_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_EVENTS + 1,
-                                                              min_interval,
-                                                              gdk_frame_clock_flush_idle,
-                                                              g_object_ref (clock_idle),
-                                                              (GDestroyNotify) g_object_unref);
+          priv->flush_idle_id = g_timeout_add_full (GDK_PRIORITY_EVENTS + 1,
+                                                    min_interval,
+                                                    gdk_frame_clock_flush_idle,
+                                                    g_object_ref (clock_idle),
+                                                    (GDestroyNotify) g_object_unref);
           g_source_set_name_by_id (priv->flush_idle_id, "[gtk+] gdk_frame_clock_flush_idle");
         }
 
       if (!priv->in_paint_idle &&
          priv->paint_idle_id == 0 && RUN_PAINT_IDLE (priv))
         {
-          priv->paint_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_REDRAW,
-                                                              min_interval,
-                                                              gdk_frame_clock_paint_idle,
-                                                              g_object_ref (clock_idle),
-                                                              (GDestroyNotify) g_object_unref);
+          priv->paint_idle_id = g_timeout_add_full (GDK_PRIORITY_REDRAW,
+                                                    min_interval,
+                                                    gdk_frame_clock_paint_idle,
+                                                    g_object_ref (clock_idle),
+                                                    (GDestroyNotify) g_object_unref);
           g_source_set_name_by_id (priv->paint_idle_id, "[gtk+] gdk_frame_clock_paint_idle");
         }
     }
@@ -364,7 +364,7 @@ gdk_frame_clock_paint_idle (void *data)
               /* We are likely not getting precisely even callbacks in real
                * time, particularly if the event loop is busy.
                * This is a documented limitation in the precision of
-               * gdk_threads_add_timeout_full and g_timeout_add_full.
+               * g_timeout_add_full().
                *
                * In order to avoid this imprecision from compounding between
                * frames and affecting visual smoothness, we correct frame_time
index 4dde62229f395a1e21eb535e540825c69df0373a..a17d531ddd8d86b95aa3df77d7f44099bb864f0f 100644 (file)
@@ -2076,8 +2076,7 @@ deliver_key_event (GdkWaylandSeat *seat,
 
   timeout = (seat->repeat_deadline - now) / 1000L;
 
-  seat->repeat_timer =
-    gdk_threads_add_timeout (timeout, keyboard_repeat, seat);
+  seat->repeat_timer = g_timeout_add (timeout, keyboard_repeat, seat);
   g_source_set_name_by_id (seat->repeat_timer, "[gtk+] keyboard_repeat");
 }
 
index 067d757e0471812cbc2540704d42303055d2cacd..190386c25a198031ca099af2515862d56a8456cd 100644 (file)
@@ -2789,9 +2789,9 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context,
   anim->frame_clock = gdk_window_get_frame_clock (win32_context->drag_window);
   anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
 
-  id = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
-                                     gdk_drag_anim_timeout, anim,
-                                     (GDestroyNotify) gdk_drag_anim_destroy);
+  id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
+                           gdk_drag_anim_timeout, anim,
+                           (GDestroyNotify) gdk_drag_anim_destroy);
   g_source_set_name_by_id (id, "[gtk+] gdk_drag_anim_timeout");
 }
 
index dc38463adce1f35298623da1e29f581a8d7f75f9..d3b0948b730c44ef5a7402b34067e6cf40f6a6c3 100644 (file)
@@ -2001,7 +2001,7 @@ queue_open_clipboard (GdkWin32ClipboardQueueAction  action,
   if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE &&
       clipboard_queue == NULL)
     {
-      id = gdk_threads_add_timeout_seconds (1, (GSourceFunc) open_clipboard_timeout, NULL);
+      id = g_timeout_add_seconds (1, (GSourceFunc) open_clipboard_timeout, NULL);
       g_source_set_name_by_id (id, "[gdk-win32] open_clipboard_timeout");
       GDK_NOTE (DND, g_print ("Started open clipboard timer\n"));
     }
index 70585c340b0812ff029f22e5c1206ee0dc26b5ad..329071650f4263595ce99ee5a7f89aebd1aeeccf 100644 (file)
@@ -2791,9 +2791,9 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context,
   anim->frame_clock = gdk_window_get_frame_clock (x11_context->drag_window);
   anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
 
-  id = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
-                                     gdk_drag_anim_timeout, anim,
-                                     (GDestroyNotify) gdk_drag_anim_destroy);
+  id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
+                           gdk_drag_anim_timeout, anim,
+                           (GDestroyNotify) gdk_drag_anim_destroy);
   g_source_set_name_by_id (id, "[gtk+] gdk_drag_anim_timeout");
 }
 
index d43ecf54856624ac549274041730a54cb52dc24c..6f46594ac3be0c7a08dc2ee3006057dbbfc94b24 100644 (file)
@@ -829,9 +829,7 @@ gtk_real_button_activate (GtkButton *button)
           priv->grab_keyboard = device;
        }
 
-      priv->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT,
-                                               button_activate_timeout,
-                                               button);
+      priv->activate_timeout = g_timeout_add (ACTIVATE_TIMEOUT, button_activate_timeout, button);
       g_source_set_name_by_id (priv->activate_timeout, "[gtk+] button_activate_timeout");
       priv->button_down = TRUE;
       gtk_button_update_state (button);
index 0899748f56d11a50dbc9be32855a59ba19547d92..2d039594963c8f93c0debdf7c9c2a81724a407d4 100644 (file)
@@ -2486,10 +2486,10 @@ calendar_timer (gpointer data)
       if (priv->need_timer)
         {
           priv->need_timer = FALSE;
-          priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
+          priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
                                             TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
                                             (GSourceFunc) calendar_timer,
-                                            (gpointer) calendar, NULL);
+                                            calendar, NULL);
           g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
         }
       else
@@ -2510,10 +2510,10 @@ calendar_start_spinning (GtkCalendar *calendar,
   if (!priv->timer)
     {
       priv->need_timer = TRUE;
-      priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
+      priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
                                         TIMEOUT_INITIAL,
                                         (GSourceFunc) calendar_timer,
-                                        (gpointer) calendar, NULL);
+                                        calendar, NULL);
       g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
     }
 }
index f0c7d07a4b9da7784a2deb63ad53c3c0cb98925d..5838d9412e61ca9ceedff75de16cad5018370a93 100644 (file)
@@ -1850,8 +1850,7 @@ gtk_cell_renderer_text_popup_unmap (GtkMenu *menu,
   if (priv->entry_menu_popdown_timeout)
     return;
 
-  priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
-                                                    data);
+  priv->entry_menu_popdown_timeout = g_timeout_add (500, popdown_timeout, data);
   g_source_set_name_by_id (priv->entry_menu_popdown_timeout, "[gtk+] popdown_timeout");
 }
 
index f072239b6d61d13c2a5c05bd049080a1dc98fbe9..571f69cd76ec17f01cb70add52ae294418ab9779 100644 (file)
@@ -1349,9 +1349,7 @@ gtk_drag_drop (GtkDragSourceInfo *info,
   if (info->icon_window)
     gtk_widget_hide (info->icon_window);
 
-  info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
-                                                gtk_drag_abort_timeout,
-                                                info);
+  info->drop_timeout = g_timeout_add (DROP_ABORT_TIME, gtk_drag_abort_timeout, info);
   g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
 }
 
index 04770910c54201dd4a563bda6e26ddefd8e88013..f1bcf6473a9ed3c003c0bed3ccccfca097395e5d 100644 (file)
@@ -4741,8 +4741,9 @@ buffer_inserted_text (GtkEntryBuffer *buffer,
           password_hint->position = position;
           if (password_hint->source_id)
             g_source_remove (password_hint->source_id);
-          password_hint->source_id = gdk_threads_add_timeout (password_hint_timeout,
-                                                              (GSourceFunc)gtk_entry_remove_password_hint, entry);
+          password_hint->source_id = g_timeout_add (password_hint_timeout,
+                                                    (GSourceFunc)gtk_entry_remove_password_hint,
+                                                    entry);
           g_source_set_name_by_id (password_hint->source_id, "[gtk+] gtk_entry_remove_password_hint");
         }
     }
@@ -8808,7 +8809,7 @@ gtk_entry_selection_bubble_popup_set (GtkEntry *entry)
     g_source_remove (priv->selection_bubble_timeout_id);
 
   priv->selection_bubble_timeout_id =
-    gdk_threads_add_timeout (50, gtk_entry_selection_bubble_popup_show, entry);
+    g_timeout_add (50, gtk_entry_selection_bubble_popup_show, entry);
   g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_entry_selection_bubble_popup_cb");
 }
 
@@ -9223,18 +9224,18 @@ blink_cb (gpointer data)
   else if (priv->cursor_visible)
     {
       hide_cursor (entry);
-      priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
-                                           blink_cb,
-                                           entry);
+      priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+                                           blink_cb,
+                                           entry);
       g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
     }
   else
     {
       show_cursor (entry);
       priv->blink_time += get_cursor_time (entry);
-      priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
-                                           blink_cb,
-                                           entry);
+      priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+                                           blink_cb,
+                                           entry);
       g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
     }
 
@@ -9251,9 +9252,9 @@ gtk_entry_check_cursor_blink (GtkEntry *entry)
       if (!priv->blink_timeout)
        {
          show_cursor (entry);
-         priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
-                                               blink_cb,
-                                               entry);
+         priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+                                               blink_cb,
+                                               entry);
          g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
        }
     }
@@ -9279,9 +9280,9 @@ gtk_entry_pend_cursor_blink (GtkEntry *entry)
       if (priv->blink_timeout != 0)
        g_source_remove (priv->blink_timeout);
 
-      priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
-                                                     blink_cb,
-                                                     entry);
+      priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+                                           blink_cb,
+                                           entry);
       g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
       show_cursor (entry);
     }
index 7dcd7e54bd8eb8f4550977a0371d0321fbfc3895..ebb2fb10dd535a7e340075e60358d9a71230c8f3 100644 (file)
@@ -2463,7 +2463,7 @@ gtk_entry_completion_changed (GtkWidget *widget,
     completion->priv->device = device;
 
   completion->priv->completion_timeout =
-    gdk_threads_add_timeout (COMPLETION_TIMEOUT,
+    g_timeout_add (COMPLETION_TIMEOUT,
                    gtk_entry_completion_timeout,
                    completion);
   g_source_set_name_by_id (completion->priv->completion_timeout, "[gtk+] gtk_entry_completion_timeout");
index 33c2d1345ccd8adae79b4eb064de538a0f16800c..763d401c315f55044b31079e76670a0a16d9dfb1 100644 (file)
@@ -584,7 +584,7 @@ gtk_expander_drag_motion (GtkWidget        *widget,
 
   if (!priv->expanded && !priv->expand_timer)
     {
-      priv->expand_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
+      priv->expand_timer = g_timeout_add (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
       g_source_set_name_by_id (priv->expand_timer, "[gtk+] expand_timeout");
     }
 
index 47cec72be286d8f571cc3075c81baed7bd7faa1f..a494a22deff28b9a09ad894c1e24c5b00de47799 100644 (file)
@@ -4280,7 +4280,7 @@ load_setup_timer (GtkFileChooserWidget *impl)
   g_assert (priv->load_timeout_id == 0);
   g_assert (priv->load_state != LOAD_PRELOAD);
 
-  priv->load_timeout_id = gdk_threads_add_timeout (MAX_LOADING_TIME, load_timeout_cb, impl);
+  priv->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl);
   g_source_set_name_by_id (priv->load_timeout_id, "[gtk+] load_timeout_cb");
   priv->load_state = LOAD_PRELOAD;
 }
index 386188d108a25d20e3062b67d0ed6256b0c9e5eb..7350a4aeb8527fa6e9648468d9c6fa370c6e79a0 100644 (file)
@@ -1146,11 +1146,10 @@ gtk_file_system_model_got_files (GObject *object, GAsyncResult *res, gpointer da
       if (model->dir_thaw_source == 0)
         {
           freeze_updates (model);
-          model->dir_thaw_source = gdk_threads_add_timeout_full (IO_PRIORITY + 1,
-                                                                 50,
-                                                                 thaw_func,
-                                                                 model,
-                                                                 NULL);
+          model->dir_thaw_source = g_timeout_add_full (IO_PRIORITY + 1, 50,
+                                                       thaw_func,
+                                                       model,
+                                                       NULL);
           g_source_set_name_by_id (model->dir_thaw_source, "[gtk+] thaw_func");
         }
 
index 948b5de9ac4747efab6db7946ef226451dd63927..2630c84238e96df55334d5f0c0ef378636a89190 100644 (file)
@@ -142,7 +142,7 @@ gtk_gesture_long_press_begin (GtkGesture       *gesture,
 
   gtk_gesture_get_point (gesture, sequence,
                          &priv->initial_x, &priv->initial_y);
-  priv->timeout_id = gdk_threads_add_timeout (delay, _gtk_gesture_long_press_timeout, gesture);
+  priv->timeout_id = g_timeout_add (delay, _gtk_gesture_long_press_timeout, gesture);
   g_source_set_name_by_id (priv->timeout_id, "[gtk+] _gtk_gesture_long_press_timeout");
 }
 
index 1f4f0e50aff906784115a3c43971cd7971ad2b27..ee925a03785012f37f8af53c44d5e70973587c40 100644 (file)
@@ -151,9 +151,7 @@ _gtk_gesture_multi_press_update_timeout (GtkGestureMultiPress *gesture)
   settings = gtk_widget_get_settings (widget);
   g_object_get (settings, "gtk-double-click-time", &double_click_time, NULL);
 
-  priv->double_click_timeout_id = gdk_threads_add_timeout (double_click_time,
-                                                           _double_click_timeout_cb,
-                                                           gesture);
+  priv->double_click_timeout_id = g_timeout_add (double_click_time, _double_click_timeout_cb, gesture);
   g_source_set_name_by_id (priv->double_click_timeout_id, "[gtk+] _double_click_timeout_cb");
 }
 
index 0a7ed4be88b81431a88f749d125312061a9d8a30..9246f9391e412c8bc90e65478cd9e4b189b01286 100644 (file)
@@ -1851,8 +1851,7 @@ gtk_icon_view_motion (GtkEventController *controller,
          icon_view->priv->event_last_y = icon_view->priv->mouse_x;
 
          if (icon_view->priv->scroll_timeout_id == 0) {
-           icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout, 
-                                                               icon_view);
+           icon_view->priv->scroll_timeout_id = g_timeout_add (30, rubberband_scroll_timeout, icon_view);
            g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] rubberband_scroll_timeout");
          }
        }
@@ -6397,8 +6396,7 @@ gtk_icon_view_drag_motion (GtkWidget      *widget,
     {
       if (icon_view->priv->scroll_timeout_id == 0)
        {
-         icon_view->priv->scroll_timeout_id =
-           gdk_threads_add_timeout (50, drag_scroll_timeout, icon_view);
+         icon_view->priv->scroll_timeout_id = g_timeout_add (50, drag_scroll_timeout, icon_view);
          g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] drag_scroll_timeout");
        }
 
index ffcaafddd23baaaf5999b20256d804268fb809dc..921592666cbaaed51327571e013f1cfe92596bfd 100644 (file)
@@ -3380,11 +3380,11 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
                                     ? -MENU_SCROLL_STEP2
                                     : -MENU_SCROLL_STEP1;
 
-              priv->scroll_timeout =
-                gdk_threads_add_timeout (scroll_fast
-                                           ? MENU_SCROLL_TIMEOUT2
-                                           : MENU_SCROLL_TIMEOUT1,
-                                         gtk_menu_scroll_timeout, menu);
+              priv->scroll_timeout = g_timeout_add (scroll_fast
+                                                      ? MENU_SCROLL_TIMEOUT2
+                                                      : MENU_SCROLL_TIMEOUT1,
+                                                    gtk_menu_scroll_timeout,
+                                                    menu);
               g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
             }
           else if (!enter && !in_arrow && priv->upper_arrow_prelight)
@@ -3451,11 +3451,11 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
                                     ? MENU_SCROLL_STEP2
                                     : MENU_SCROLL_STEP1;
 
-              priv->scroll_timeout =
-                gdk_threads_add_timeout (scroll_fast
-                                           ? MENU_SCROLL_TIMEOUT2
-                                           : MENU_SCROLL_TIMEOUT1,
-                                         gtk_menu_scroll_timeout, menu);
+              priv->scroll_timeout = g_timeout_add (scroll_fast
+                                                      ? MENU_SCROLL_TIMEOUT2
+                                                      : MENU_SCROLL_TIMEOUT1,
+                                                    gtk_menu_scroll_timeout,
+                                                    menu);
               g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
             }
           else if (!enter && !in_arrow && priv->lower_arrow_prelight)
index e7bacd2a88349fcd19aecde186dd5f5688c60dbe..7dddb7adc91a718c35374ac8b4c3e48bd8b3be32 100644 (file)
@@ -1568,9 +1568,7 @@ _gtk_menu_item_popup_submenu (GtkWidget *widget,
           info->menu_item = menu_item;
           info->trigger_event = gtk_get_current_event ();
 
-          priv->timer = gdk_threads_add_timeout (popup_delay,
-                                                 gtk_menu_item_popup_timeout,
-                                                 info);
+          priv->timer = g_timeout_add (popup_delay, gtk_menu_item_popup_timeout, info);
           g_source_set_name_by_id (priv->timer, "[gtk+] gtk_menu_item_popup_timeout");
 
           return;
index 4e7e7dee46c93bad892b44a46e7e2f3ebb49bff8..b14449dc9b1556a12922c5636dde8c6248ab2525 100644 (file)
@@ -2738,9 +2738,9 @@ gtk_notebook_motion (GtkEventController *controller,
           if (!priv->dnd_timer)
             {
               priv->has_scrolled = TRUE;
-              priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
+              priv->dnd_timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
                                                scroll_notebook_timer,
-                                               (gpointer) notebook);
+                                               notebook);
               g_source_set_name_by_id (priv->dnd_timer, "[gtk+] scroll_notebook_timer");
             }
         }
@@ -3138,9 +3138,7 @@ gtk_notebook_drag_motion (GtkWidget      *widget,
 
       if (!priv->switch_tab_timer)
         {
-          priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
-                                                  gtk_notebook_switch_tab_timeout,
-                                                  widget);
+          priv->switch_tab_timer = g_timeout_add (TIMEOUT_EXPAND, gtk_notebook_switch_tab_timeout, widget);
           g_source_set_name_by_id (priv->switch_tab_timer, "[gtk+] gtk_notebook_switch_tab_timeout");
         }
     }
@@ -4127,9 +4125,9 @@ gtk_notebook_timer (GtkNotebook *notebook)
       if (priv->need_timer)
         {
           priv->need_timer = FALSE;
-          priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
-                                           (GSourceFunc) gtk_notebook_timer,
-                                           (gpointer) notebook);
+          priv->timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
+                                       (GSourceFunc) gtk_notebook_timer,
+                                       notebook);
           g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
         }
       else
@@ -4146,9 +4144,9 @@ gtk_notebook_set_scroll_timer (GtkNotebook *notebook)
 
   if (!priv->timer)
     {
-      priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
-                                       (GSourceFunc) gtk_notebook_timer,
-                                       (gpointer) notebook);
+      priv->timer = g_timeout_add (TIMEOUT_INITIAL,
+                                   (GSourceFunc) gtk_notebook_timer,
+                                   notebook);
       g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
       priv->need_timer = TRUE;
     }
index 2d11bce5b07c9a92d5cf1b130dbc4052e6e0d3c7..71c5688f682032b9fc4c843ef109dbb8b1f533ab 100644 (file)
@@ -517,7 +517,7 @@ win32_poll_status_timeout (GtkPrintOperation *op)
   win32_poll_status (op);
 
   if (!gtk_print_operation_is_finished (op)) {
-    op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
+    op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
                                          (GSourceFunc)win32_poll_status_timeout,
                                          op);
     g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
@@ -561,7 +561,7 @@ win32_end_run (GtkPrintOperation *op,
     {
       op_win32->printerHandle = printerHandle;
       win32_poll_status (op);
-      op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
+      op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
                                            (GSourceFunc)win32_poll_status_timeout,
                                            op);
       g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
index cd2a082af3c63f6967c9a1b45fecc945c166b21d..68a2e1555c31c13a4e94e86835273da083528b56 100644 (file)
@@ -3008,9 +3008,9 @@ print_pages (GtkPrintOperation       *op,
                        G_CALLBACK (handle_progress_response), op);
 
       priv->show_progress_timeout_id = 
-       gdk_threads_add_timeout (SHOW_PROGRESS_TIME, 
-                      (GSourceFunc)show_progress_timeout,
-                      data);
+       g_timeout_add (SHOW_PROGRESS_TIME,
+                       (GSourceFunc) show_progress_timeout,
+                       data);
       g_source_set_name_by_id (priv->show_progress_timeout_id, "[gtk+] show_progress_timeout");
 
       data->progress = progress;
index d6464e30f0c8000a7b2145c8a34815ed0fa23818..54b4186af30835cf11c1ca7197ecd4ec7b15eab3 100644 (file)
@@ -2890,9 +2890,7 @@ initial_timeout (gpointer data)
   GtkRange *range = GTK_RANGE (data);
   GtkRangePrivate *priv = range->priv;
 
-  priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT,
-                                                     second_timeout,
-                                                     range);
+  priv->timer->timeout_id = g_timeout_add (TIMEOUT_REPEAT, second_timeout, range);
   g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] second_timeout");
   return G_SOURCE_REMOVE;
 }
@@ -2908,9 +2906,7 @@ gtk_range_add_step_timer (GtkRange      *range,
 
   priv->timer = g_new (GtkRangeStepTimer, 1);
 
-  priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
-                                                     initial_timeout,
-                                                     range);
+  priv->timer->timeout_id = g_timeout_add (TIMEOUT_INITIAL, initial_timeout, range);
   g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] initial_timeout");
   priv->timer->step = step;
 
index b241ba251fe5ef9a36524347de5296ec1df262e5..d6806da57c623898ab6527b7cdba2deda6b851c7 100644 (file)
@@ -1422,7 +1422,7 @@ gtk_recent_manager_changed (GtkRecentManager *manager)
    */
   if (manager->priv->changed_timeout == 0)
     {
-      manager->priv->changed_timeout = gdk_threads_add_timeout (250, emit_manager_changed, manager);
+      manager->priv->changed_timeout = g_timeout_add (250, emit_manager_changed, manager);
       g_source_set_name_by_id (manager->priv->changed_timeout, "[gtk+] emit_manager_changed");
     }
   else
index 7936c8b8776242fdaa2055ef1d48e16fe420f126..704d6c1581c2ccecc60bc7a529c01d5668c5b2c6 100644 (file)
@@ -1161,7 +1161,7 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
     indicator_set_over (indicator, TRUE);
   else if (indicator_close && !on_other_scrollbar)
     {
-      indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
+      indicator->over_timeout_id = g_timeout_add (30, enable_over_timeout_cb, indicator);
       g_source_set_name_by_id (indicator->over_timeout_id, "[gtk+] enable_over_timeout_cb");
     }
   else
@@ -1381,7 +1381,7 @@ scroll_controller_scroll (GtkEventControllerScroll *scroll,
       _gtk_scrolled_window_get_overshoot (scrolled_window, NULL, NULL))
     {
       priv->scroll_events_overshoot_id =
-        gdk_threads_add_timeout (50, start_scroll_deceleration_cb, scrolled_window);
+        g_timeout_add (50, start_scroll_deceleration_cb, scrolled_window);
       g_source_set_name_by_id (priv->scroll_events_overshoot_id,
                                "[gtk+] start_scroll_deceleration_cb");
     }
index af5784bfd360a035ea4e0dfbba959357ffae0c15..1f28ceef2bac0228e4d22907edbe8f338b491f0e 100644 (file)
@@ -775,7 +775,7 @@ start_spinning (GtkSpinButton *spin,
     {
       priv->timer_step = step;
       priv->need_timer = TRUE;
-      priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
+      priv->timer = g_timeout_add (TIMEOUT_INITIAL,
                                    (GSourceFunc) gtk_spin_button_timer,
                                    (gpointer) spin);
       g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
@@ -1153,9 +1153,9 @@ gtk_spin_button_timer (GtkSpinButton *spin_button)
       if (priv->need_timer)
         {
           priv->need_timer = FALSE;
-          priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT,
-                                              (GSourceFunc) gtk_spin_button_timer,
-                                              (gpointer) spin_button);
+          priv->timer = g_timeout_add (TIMEOUT_REPEAT,
+                                       (GSourceFunc) gtk_spin_button_timer,
+                                       spin_button);
           g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
         }
       else
index 36c2f2ea274f4c56fbf4adb60a36b4eaf80778f0..5495591ab891d0f72ebfe43856156ea2ec0274b6 100644 (file)
@@ -327,9 +327,9 @@ gtk_stack_switcher_drag_motion (GtkWidget      *widget,
 
   if (button && !priv->switch_timer)
     {
-      priv->switch_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
-                                                    gtk_stack_switcher_switch_timeout,
-                                                    self);
+      priv->switch_timer = g_timeout_add (TIMEOUT_EXPAND,
+                                          gtk_stack_switcher_switch_timeout,
+                                          self);
       g_source_set_name_by_id (priv->switch_timer, "[gtk+] gtk_stack_switcher_switch_timeout");
     }
 
index 9dbfa525377877cd0f7eef1bf391e41a5aa095a7..171467c0b027dca5f4ba3c110875834c2bf2aeef 100644 (file)
@@ -5877,16 +5877,16 @@ blink_cb (gpointer data)
     } 
   else if (visible)
     {
-      priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
-                                                    blink_cb,
-                                                    text_view);
+      priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+                                           blink_cb,
+                                           text_view);
       g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
     }
   else 
     {
-      priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
-                                                    blink_cb,
-                                                    text_view);
+      priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+                                           blink_cb,
+                                           text_view);
       g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
       priv->blink_time += get_cursor_time (text_view);
     }
@@ -5935,9 +5935,9 @@ gtk_text_view_check_cursor_blink (GtkTextView *text_view)
            {
              gtk_text_layout_set_cursor_visible (priv->layout, TRUE);
              
-             priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
-                                                            blink_cb,
-                                                            text_view);
+             priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+                                                   blink_cb,
+                                                   text_view);
              g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
            }
        }
@@ -5967,9 +5967,9 @@ gtk_text_view_pend_cursor_blink (GtkTextView *text_view)
       gtk_text_view_stop_cursor_blink (text_view);
       gtk_text_layout_set_cursor_visible (priv->layout, TRUE);
       
-      priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
-                                                    blink_cb,
-                                                    text_view);
+      priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+                                           blink_cb,
+                                           text_view);
       g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
     }
 }
@@ -7327,8 +7327,7 @@ gtk_text_view_drag_gesture_update (GtkGestureDrag *gesture,
   if (text_view->priv->scroll_timeout != 0) /* reset on every motion event */
     g_source_remove (text_view->priv->scroll_timeout);
 
-  text_view->priv->scroll_timeout =
-    gdk_threads_add_timeout (50, selection_scan_timeout, text_view);
+  text_view->priv->scroll_timeout = g_timeout_add (50, selection_scan_timeout, text_view);
   g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] selection_scan_timeout");
 
   gtk_text_view_selection_bubble_popup_unset (text_view);
@@ -8021,8 +8020,7 @@ gtk_text_view_drag_motion (GtkWidget        *widget,
 
   if (!priv->scroll_timeout)
   {
-    priv->scroll_timeout =
-      gdk_threads_add_timeout (100, drag_scan_timeout, text_view);
+    priv->scroll_timeout = g_timeout_add (100, drag_scan_timeout, text_view);
     g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] drag_scan_timeout");
   }
 
@@ -9086,9 +9084,7 @@ gtk_text_view_selection_bubble_popup_set (GtkTextView *text_view)
   if (priv->selection_bubble_timeout_id)
     g_source_remove (priv->selection_bubble_timeout_id);
 
-  priv->selection_bubble_timeout_id =
-    gdk_threads_add_timeout (50, gtk_text_view_selection_bubble_popup_show,
-                             text_view);
+  priv->selection_bubble_timeout_id = g_timeout_add (50, gtk_text_view_selection_bubble_popup_show, text_view);
   g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_text_view_selection_bubble_popup_cb");
 }
 
index eed1a56380794d04d3b531c6470ced2844e43202..80b340a70a62de7b00248b2648e137a604b5818a 100644 (file)
@@ -965,10 +965,10 @@ gtk_tooltip_hide_tooltip (GtkTooltip *tooltip)
       if (!tooltip->browse_mode_timeout_id)
         {
          tooltip->browse_mode_timeout_id =
-           gdk_threads_add_timeout_full (0, timeout,
-                                         tooltip_browse_mode_expired,
-                                         g_object_ref (tooltip),
-                                         g_object_unref);
+           g_timeout_add_full (0, timeout,
+                                tooltip_browse_mode_expired,
+                                g_object_ref (tooltip),
+                                g_object_unref);
          g_source_set_name_by_id (tooltip->browse_mode_timeout_id, "[gtk+] tooltip_browse_mode_expired");
        }
     }
@@ -1029,10 +1029,10 @@ gtk_tooltip_start_delay (GdkDisplay *display)
   else
     timeout = HOVER_TIMEOUT;
 
-  tooltip->timeout_id = gdk_threads_add_timeout_full (0, timeout,
-                                                     tooltip_popup_timeout,
-                                                     g_object_ref (display),
-                                                     g_object_unref);
+  tooltip->timeout_id = g_timeout_add_full (0, timeout,
+                                            tooltip_popup_timeout,
+                                            g_object_ref (display),
+                                            g_object_unref);
   g_source_set_name_by_id (tooltip->timeout_id, "[gtk+] tooltip_popup_timeout");
 }
 
index 85711511e7b88b05a6cf8c23d02f40cc39864c35..fb0c380e6f2d73a9b9e6c29942907c14f280d1fa 100644 (file)
@@ -3486,7 +3486,7 @@ do_prelight (GtkTreeView *tree_view,
   if (tree_view->priv->hover_expand)
     {
       tree_view->priv->auto_expand_timeout = 
-       gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
+       g_timeout_add (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
       g_source_set_name_by_id (tree_view->priv->auto_expand_timeout, "[gtk+] auto_expand_timeout");
     }
 }
@@ -7122,8 +7122,7 @@ add_scroll_timeout (GtkTreeView *tree_view)
 {
   if (tree_view->priv->scroll_timeout == 0)
     {
-      tree_view->priv->scroll_timeout =
-       gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
+      tree_view->priv->scroll_timeout = g_timeout_add (150, scroll_row_timeout, tree_view);
       g_source_set_name_by_id (tree_view->priv->scroll_timeout, "[gtk+] scroll_row_timeout");
     }
 }
@@ -7687,7 +7686,7 @@ gtk_tree_view_drag_motion (GtkWidget        *widget,
            pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE))
         {
           tree_view->priv->open_dest_timeout =
-            gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
+            g_timeout_add (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
           g_source_set_name_by_id (tree_view->priv->open_dest_timeout, "[gtk+] open_row_timeout");
         }
       else
@@ -10811,9 +10810,9 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view,
     }
 
   tree_view->priv->typeselect_flush_timeout =
-    gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
-                  (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
-                  tree_view);
+    g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+                   (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
+                   tree_view);
   g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
 
   /* send focus-in event */
@@ -14383,8 +14382,8 @@ gtk_tree_view_search_preedit_changed (GtkIMContext *im_context,
     {
       g_source_remove (tree_view->priv->typeselect_flush_timeout);
       tree_view->priv->typeselect_flush_timeout =
-       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
-                      (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
+       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
       g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
     }
@@ -14437,8 +14436,10 @@ static void
 gtk_tree_view_search_enable_popdown (GtkWidget *widget,
                                     gpointer   data)
 {
-  guint id;
-  id = gdk_threads_add_timeout_full (G_PRIORITY_HIGH, 200, gtk_tree_view_real_search_enable_popdown, g_object_ref (data), g_object_unref);
+  guint id = g_timeout_add_full (G_PRIORITY_HIGH, 200,
+                                 gtk_tree_view_real_search_enable_popdown,
+                                 g_object_ref (data),
+                                 g_object_unref);
   g_source_set_name_by_id (id, "[gtk+] gtk_tree_view_real_search_enable_popdown");
 }
 
@@ -14482,7 +14483,7 @@ gtk_tree_view_search_scroll_event (GtkWidget   *widget,
     {
       g_source_remove (tree_view->priv->typeselect_flush_timeout);
       tree_view->priv->typeselect_flush_timeout =
-       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
       g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
@@ -14559,7 +14560,7 @@ gtk_tree_view_search_key_press_event (GtkWidget *widget,
     {
       g_source_remove (tree_view->priv->typeselect_flush_timeout);
       tree_view->priv->typeselect_flush_timeout =
-       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
       g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
@@ -14812,7 +14813,7 @@ gtk_tree_view_search_init (GtkWidget   *entry,
     {
       g_source_remove (tree_view->priv->typeselect_flush_timeout);
       tree_view->priv->typeselect_flush_timeout =
-       gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+       g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
                       (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
                       tree_view);
       g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
index 296aa5dc1ffdbeaebb7593fc12ac38d3abc0a142..3e20ca80c7f392082991858311764898e7d8e4b3 100644 (file)
@@ -10690,7 +10690,7 @@ _gtk_window_schedule_mnemonics_visible (GtkWindow *window)
     return;
 
   window->priv->mnemonics_display_timeout_id =
-    gdk_threads_add_timeout (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
+    g_timeout_add (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
   g_source_set_name_by_id (window->priv->mnemonics_display_timeout_id, "[gtk+] schedule_mnemonics_visible_cb");
 }
 
index 2c364187a3e56c615abcab7ae78bd6e71a90d461..6d7ddb2377321bd0f3286e9f9a184a8a0b1b2d73 100644 (file)
@@ -542,7 +542,7 @@ map (GtkWidget *widget)
 
   GTK_WIDGET_CLASS (gtk_inspector_misc_info_parent_class)->map (widget);
 
-  sl->priv->update_source_id = gdk_threads_add_timeout_seconds (1, update_info, sl);
+  sl->priv->update_source_id = g_timeout_add_seconds (1, update_info, sl);
   update_info (sl);
 }
 
index 5bf6e7c145ba369ef3cf7c0862805ea6c0ae3282..bce187b9d68aca2e0d2901c4ef6f2d0262ec0190 100644 (file)
@@ -151,9 +151,7 @@ toggle_record (GtkToggleButton        *button,
 
   if (gtk_toggle_button_get_active (button))
     {
-      sl->priv->update_source_id = gdk_threads_add_timeout_seconds (1,
-                                                                    update_type_counts,
-                                                                    sl);
+      sl->priv->update_source_id = g_timeout_add_seconds (1, update_type_counts, sl);
       update_type_counts (sl);
     }
   else
index 3751b2d8c03383ba2e8b8aae0a32d87511135634..4e6091ea2dfbb740d79d0020f429292f78a6ffb6 100644 (file)
@@ -3706,9 +3706,7 @@ cups_request_printer_list (GtkPrintBackendCups *cups_backend)
       cups_backend->list_printers_attempts = -1;
       if (cups_backend->list_printers_poll > 0)
         g_source_remove (cups_backend->list_printers_poll);
-      cups_backend->list_printers_poll = gdk_threads_add_timeout (200,
-                                           (GSourceFunc) cups_request_printer_list,
-                                           cups_backend);
+      cups_backend->list_printers_poll = g_timeout_add (200, (GSourceFunc) cups_request_printer_list, cups_backend);
       g_source_set_name_by_id (cups_backend->list_printers_poll, "[gtk+] cups_request_printer_list");
     }
   else if (cups_backend->list_printers_attempts != -1)
@@ -3757,9 +3755,7 @@ cups_get_printer_list (GtkPrintBackend *backend)
     {
       if (cups_request_printer_list (cups_backend))
         {
-          cups_backend->list_printers_poll = gdk_threads_add_timeout (50,
-                                               (GSourceFunc) cups_request_printer_list,
-                                               backend);
+          cups_backend->list_printers_poll = g_timeout_add (50, (GSourceFunc) cups_request_printer_list, backend);
           g_source_set_name_by_id (cups_backend->list_printers_poll, "[gtk+] cups_request_printer_list");
         }
 
@@ -3898,9 +3894,7 @@ cups_request_ppd (GtkPrinter *printer)
               cups_printer->get_remote_ppd_attempts = -1;
               if (cups_printer->get_remote_ppd_poll > 0)
                 g_source_remove (cups_printer->get_remote_ppd_poll);
-              cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (200,
-                                                    (GSourceFunc) cups_request_ppd,
-                                                    printer);
+              cups_printer->get_remote_ppd_poll = g_timeout_add (200, (GSourceFunc) cups_request_ppd, printer);
               g_source_set_name_by_id (cups_printer->get_remote_ppd_poll, "[gtk+] cups_request_ppd");
             }
           else if (cups_printer->get_remote_ppd_attempts != -1)
@@ -4164,9 +4158,7 @@ cups_get_default_printer (GtkPrintBackendCups *backend)
     {
       if (cups_request_default_printer (cups_backend))
         {
-          cups_backend->default_printer_poll = gdk_threads_add_timeout (200,
-                                                 (GSourceFunc) cups_request_default_printer,
-                                                 backend);
+          cups_backend->default_printer_poll = g_timeout_add (200, (GSourceFunc) cups_request_default_printer, backend);
           g_source_set_name_by_id (cups_backend->default_printer_poll, "[gtk+] cups_request_default_printer");
         }
     }
@@ -4306,9 +4298,7 @@ cups_printer_request_details (GtkPrinter *printer)
 
               if (cups_request_ppd (printer))
                 {
-                  cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (50,
-                                                      (GSourceFunc) cups_request_ppd,
-                                                      printer);
+                  cups_printer->get_remote_ppd_poll = g_timeout_add (50, (GSourceFunc) cups_request_ppd, printer);
                   g_source_set_name_by_id (cups_printer->get_remote_ppd_poll, "[gtk+] cups_request_ppd");
                 }
             }
index d0331071c585d20a9e071ce9d3b20c915e626424..6b2ae17c04a425052a310d1a56a151b4e31f5255 100644 (file)
@@ -136,7 +136,7 @@ prepare_callback (GtkWidget *widget, GtkWidget *page)
     {
       gtk_assistant_set_page_complete (GTK_ASSISTANT (widget), page, FALSE);
       gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (page), 0.0);
-      gdk_threads_add_timeout (300, (GSourceFunc) progress_timeout, widget);
+      g_timeout_add (300, (GSourceFunc) progress_timeout, widget);
     }
   else
     g_print ("prepare: %d\n", gtk_assistant_get_current_page (GTK_ASSISTANT (widget)));
index a56c3b98c3ff69635c2573d39a4d449072f586db..e60e361d06e47e295c81e5bb5f7f5f307d32ef4e 100644 (file)
@@ -1347,7 +1347,7 @@ main (int argc, char **argv)
         gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combobox), &iter);
 
 #if 1
-       gdk_threads_add_timeout (1000, (GSourceFunc) capital_animation, model);
+       g_timeout_add (1000, (GSourceFunc) capital_animation, model);
 #endif
 
         /* Aligned Food */
index 78d69e70e0d5fc7a312dd441b2b7ab2c19b20eb1..6b13d8d163a62bcd3a24c41318f285511266404e 100644 (file)
@@ -215,7 +215,7 @@ on_animate (void)
 {
   n_animations += 20;
  
-  timer = gdk_threads_add_timeout (1000, (GSourceFunc) animation_timer, NULL);
+  timer = g_timeout_add (1000, (GSourceFunc) animation_timer, NULL);
 }
 
 int
index cda048f4b3f0063d403b865613ce3872842cd9c8..165ca76e50e2890639b743de65cb370847b53915 100644 (file)
@@ -469,7 +469,7 @@ popup_leave    (GtkWidget          *widget,
       if (!popdown_timer)
        {
          g_print ("added popdown\n");
-         popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
+         popdown_timer = g_timeout_add (500, popdown_cb, NULL);
        }
     }
 }
@@ -519,7 +519,7 @@ popup_cb (gpointer data)
       popped_up = TRUE;
     }
 
-  popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
+  popdown_timer = g_timeout_add (500, popdown_cb, NULL);
   g_print ("added popdown\n");
 
   popup_timer = FALSE;
@@ -535,7 +535,7 @@ popsite_motion         (GtkWidget          *widget,
                    guint               time)
 {
   if (!popup_timer)
-    popup_timer = gdk_threads_add_timeout (500, popup_cb, NULL);
+    popup_timer = g_timeout_add (500, popup_cb, NULL);
 
   return TRUE;
 }
index 8d30b70d090ac58de1137951957e82d9c0d64f44..09a2b4dbab5918b85f868a08bdebffa5c45d6a5d 100644 (file)
@@ -389,7 +389,7 @@ main (int argc, char *argv[])
   gtk_entry_completion_set_text_column (completion, 0);
 
   /* Fill the completion dynamically */
-  gdk_threads_add_timeout (1000, (GSourceFunc) animation_timer, completion);
+  g_timeout_add (1000, (GSourceFunc) animation_timer, completion);
 
   /* Fourth entry */
   gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Model-less entry completion"));
index 11d72949e7b896b8d2c43fe82cb5b64947daacc9..65d9b2cabfa5e79491eb4fb5627ffc1920a535c0 100644 (file)
@@ -2884,9 +2884,7 @@ entry_toggle_progress (GtkWidget *checkbutton,
 {
   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)))
     {
-      guint timeout = gdk_threads_add_timeout (100,
-                                               entry_progress_timeout,
-                                               entry);
+      guint timeout = g_timeout_add (100, entry_progress_timeout, entry);
       g_object_set_data_full (G_OBJECT (entry), "timeout-id",
                               GUINT_TO_POINTER (timeout),
                               entry_remove_timeout);
index 8fbad8e18619b5d61bc2b223bba5a88e9040e123..c370e5550cdc29baf301603f15c61c8b064fe085 100644 (file)
@@ -513,7 +513,7 @@ main (gint argc, gchar **argv)
   gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), "Custom label");
   add_item_to_list (store, item, "New");
   gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
-  gdk_threads_add_timeout (3000, (GSourceFunc) timeout_cb, item);
+  g_timeout_add (3000, (GSourceFunc) timeout_cb, item);
   gtk_tool_item_set_expand (item, TRUE);
 
   menu = gtk_menu_new ();
@@ -533,7 +533,7 @@ main (gint argc, gchar **argv)
   gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (item), menu);
   add_item_to_list (store, item, "Open");
   gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
-  gdk_threads_add_timeout (3000, (GSourceFunc) timeout_cb1, item);
+  g_timeout_add (3000, (GSourceFunc) timeout_cb1, item);
  
   menu = gtk_menu_new ();
   for (i = 0; i < 20; i++)
index 60d6ff7bef95e38b43cc56592cd4b30ee69a26ed..6a6e4cca96956b185dc3e20ee13132f036d6f2ea 100644 (file)
@@ -165,7 +165,7 @@ main (int argc, char *argv[])
   g_signal_connect (button, "realize", G_CALLBACK (gtk_widget_grab_focus), NULL);
   gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
   gtk_widget_show (window);
-  gdk_threads_add_timeout (1000, (GSourceFunc) futz, NULL);
+  g_timeout_add (1000, (GSourceFunc) futz, NULL);
   gtk_main ();
   return 0;
 }